package practice;
abstract class VehicleT{
    private String brand;
    private int speed;
    public VehicleT(){}
    public VehicleT(String brand,int speed){
        this.brand=brand;
        this.speed=speed;
    }
    public String getBrand(){
        return brand;
    }
    public int getSpeed(){
        return speed;
    }
    public abstract void run();
}
class Trator extends VehicleT{
    public Trator(String brand, int speed) {
    super(brand, speed);
    }
@Override//对父类方法的重写
    public void run() {
    System.out.println(getBrand() + "wenwen at" + getSpeed() + "tuola");
    }
}
class Truck extends VehicleT{
    public Truck(String brand,int speed){
        super(brand, speed);
    }
    @Override
    public void run(){
        System.out.println(getBrand()+"guodao"+getSpeed()+"跟我的保险说去吧");
    }
}
class Benchi extends VehicleT{
    public Benchi(String brand,int speed){
        super(brand, speed);
    }
    @Override
    public void run(){
        System.out.println(getBrand()+"美女"+getSpeed()+"爽");
    }
}


public class Vehicle {
    public static void main(String[] args) {
        VehicleT tartor=new Trator("蓝翔",20);
        VehicleT truck=new Truck("德邦",90);
        VehicleT benchi=new Benchi("AMG",180);
        tartor.run();
        truck.run();
        benchi.run();
    }
}
